point, you will see the effect of 1.71.Figure 1.71 Running effectXcode writing codeCode is a collection of command sequences that are written in a computer language to implement a particular function. Now it's time to implement the display of the tag through the code. The following steps are described:(1 Open the Gamescene.swift file for the Hello World project and delete the unused code, with the remaining code as follows:
Import SpriteKit
Class Gamescene:skscene {
Override f
Series name
Version
Academy Engraved Let
7.0d1e1
American Typewriter
7.0d1e1
Apple Color Emoji
7.0d18e1
Applegothic
7.0d5e1
Arial
Version 5.01.2x
Arial Hebrew
6.0d2e1
Arial rounded MT Bold
Version 1.51x
Bangla Sangam MN
7.0d4e1
Baskerville
7.0d4e2
Bodoni 72
7.0d1e2
Bodoni Oldstyle
7.0d
the pure sky in the upper part of the picture, and the keyboard shortcuts use ctrl+t to stretch it. If the stretch part does not have the obvious trace, then does not need to use the imitation stamp and so on the tool to cover the trace, therefore may enter the next step.
Cropping again: After completing the above steps, again using the cutting tool to cut the picture after stretching to two times the purpose of composition.
Add text: Before filming, I set the name of t
addchild:background]; Create a text label Cclabelttf *label = [Cclabelttf labelwithstring:@ "Hello Beyond" fontname:@ "Chalkduster" fontsize:36.0f]; Label.positiontype = ccpositiontypenormalized; Label.color = [Cccolor Redcolor]; The positive center of the screen is the Cartesian coordinate system, where the origin is in the lower left label.position = CCP (0.5f, 0.5f); [Self Addchild:label]; Create a Start button and click to go t
to do this either in init or viewDidLoad.In viewDidLoad, first instantiate a MyScene and set this MyScene with scaleMode to SKSceneScaleModeAspectFill. At last, we will present the scene on The view.The above steps are common practices.MyScene-(id)initWithSize:(CGSize)size { if (self = [super initWithSize:size]) { self.backgroundColor = [SKColor colorWithRed:0.15 green:0.15 blue:0.3 alpha:1.0]; SKLabelNode *myLabel = [SKLabelNode labelNodeWithFontNamed:@
) if error { println("load background music error : \(error)") } else { backgroundMusicPlayer!.numberOfLoops = -1 backgroundMusicPlayer!.prepareToPlay() backgroundMusicPlayer!.play() } }
override func viewDidLoad() { super.viewDidLoad() setupMedia() }
Start playing when the view is loaded.
Game scenarios
We have created a skscene subclass to compile game display and logic. Class gamescene: skscene
Victory
fontWithName:@"woziku-bsdsm-CN4262" size:18];self.showLabel.text = @"湖工电气";5. Use in IB6. View the fonts inside Xcode// 打印字体letUIFont.familyNames()print(fonts)In the print results, we can see the three fonts we added: Amano,amelia BT and woziku-bsdsm-cn4262.["Copperplate","Heiti SC","Iowan old Style","Kohinoor Telugu","Courier New","Heiti TC","Gill Sans","Apple SD Gothic Neo","woziku-bsdsm-cn4262","Marker Felt","Thonburi","Avenir Next Condensed","Tamil Sangam MN","Helvetica Neue","Gurmukhi MN",
: \ (Error)") } else { c6/>backgroundmusicplayer!. Numberofloops =-1 backgroundmusicplayer!. Preparetoplay () backgroundmusicplayer!. Play () } } Override Func Viewdidload () { super.viewdidload () Setupmedia () }Starts playing when the view loading is complete.Game sceneWe have built a Skscene subclass for game display and logic writing. Class Gamescene:sksceneVictory failure ScenarioClass Gameoverscene:skscene {convenience init (size:c
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.